require(['config'],function(){
    require(['jquery'],function($){

        console.log($);
        $('button').on('click',function(e){
            e.preventDefault()
            
            // 发送ajax请求
            $.ajax({
                type: "POST",
                url: "../php/register.php",
                data: {
                    username: $(".item_account").eq(0).val(),
                    password: $(".item_account").eq(1).val(),
                    repassword: $(".item_account").eq(2).val(),
                    createTime: (new Date()).getTime()
                },
                success: function(result){
                    console.log(result);
                    var obj = JSON.parse(result);
                    if(obj.code ){
                        alert(obj.message)
                    }
                },
                error: function(msg){
                    console.log(msg);
                }
            })
            
            

        })
    })
})